package com.njuse.jvmfinal.Instruction;

import java.nio.ByteBuffer;

import com.njuse.jvmfinal.runtimestructure.Jframe;

public class IXOR extends Instruction {
	public  void readindex(ByteBuffer reader) {
		//no need to read
	}
	
	public  void execute(Jframe frame) {
		int top=frame.getStacktop();
		Object[] stack=frame.getManagestack();
        int a=(int)stack[top-1];
        int b=(int)stack[top-2];
        top=top-2;
        int result=b ^ a;
        stack[top]=result;
        top++;
        frame.setManagestack(stack);
        frame.setStacktop(top);
	}
}
